﻿using System;
using System.Collections.Generic;
using System.Linq;
using KaytechSoftware.Cms.Entities;
using KaytechSoftware.Cms.Entities.Interfaces;
using KaytechSoftware.Cms.Services.Dto;
using KaytechSoftware.Cms.Services.Interfaces.Entity;

namespace KaytechSoftware.Cms.Services.Services.Entity
{
    public class RightSideRendererService : EntityBaseService<RightSideRenderer, RightSideRendererDto>, IRightSideRendererService
    {
        public RightSideRendererService(IUnitOfWorkService unitOfWorkService, IRepository<RightSideRenderer> rightSideRendererRepository) : base(unitOfWorkService, rightSideRendererRepository)
        {
        }

        public override void Save(RightSideRendererDto dto)
        {
            throw new NotImplementedException();
        }

        public override IList<RightSideRendererDto> GetAll()
        {
            using (UnitOfWorkService.Create())
            {
                var pages = EntityRepository.GetAll().ToList();
                return pages.Select(r => new RightSideRendererDto(r)).ToList();
            }
        }
    }
}
